#!/bin/bash
### The script does kubernetes deployment from k8s/app config definitions. 
### It includes all the component except gitlab, as gitlab should be up and running when other gets deployed.
### It is being called in bin/k8s-review-deploy


cd "$(dirname "$0")"/..
set -e
set -x


## ConfigMap for CA CERT to gitlab runner k8s cluster. It will be used for gitlab-runner pod creation.
kubectl delete configmap k8s-runner-ca-crt || echo "configmap k8s-runner-ca-crt does not exist"
kubectl  create configmap k8s-runner-ca-crt --from-file=$(pwd)/k8s-runner-ca.crt

## Deploy all services other than gitlab. The yml got generated through k8s/prepare-final-deployment-yml
kubectl apply -f apps-${dashed_domain}.yml

